<?php

namespace app\shop\model\coupon;

use app\shop\model\BaseModel;
use app\shop\model\user\UserCouponModel;
use think\model\concern\SoftDelete;
use think\model\relation\HasMany;

class CouponModel extends BaseModel
{
    use SoftDelete;

    protected $name = 'shop_coupon';

    /**
     * 用户优惠券关联
     * @return HasMany
     */
    public function userCoupon(): HasMany
    {
        return $this->hasMany(UserCouponModel::class, 'coupon_id', 'id');
    }
}